package poo.esempi;

import java.util.Scanner;
import java.util.Stack;

public class StringaDiParentesi {

	public static void main(String[] args) {

		String schema = "[\\(\\)\\{\\}\\[\\]]+";
		Stack<Character> s = new Stack<>();
		Scanner sc = new Scanner(System.in);
		System.out.println("Fornisci una stringa di parentesi: ");
		String p = sc.nextLine();
		if (!p.matches(schema)) {
			System.out.println("Espressione malformata!");
			System.exit(-1);
		}
		
	}

}
